Locate suppressions at their comment's # in pyrefly coverage#4030
Locate suppressions at their comment's # in pyrefly coverage#4030jorenham wants to merge 1 commit into
# in pyrefly coverage#4030Conversation
This comment has been minimized.
This comment has been minimized.
|
rebased onto main to resolve the merge conflicts |
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
NathanTempest
left a comment
There was a problem hiding this comment.
Great fix as always @jorenham, LGTM for import.
Recording the string-aware comment_offset at parse time (where the triple-quote state is already tracked) is the right fix, and routing coverage through module.ignore() + range_to_location is a good cleanup that also reuses the canonical parse instead of re-parsing. Bonus: dropping the old line.find('#') removes a latent byte-vs-display column bug for multibyte lines too.
|
@NathanTempest has imported this pull request. If you are a Meta employee, you can view this in D111306424. |
stroxler
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
@NathanTempest merged this pull request in 5b8f0d4. |
Summary
Suppressionnow records the string-aware comment offset already known at parse time, sopyrefly coverage reportno longer points a suppression at a#inside a string literal.Fixes #4022
Test Plan
Regression tests added